/* Janus Chat - Version 1.0
 * Authors: Matthew Perry
 *          Michael Freid
 *          Marc Latou
 *          Richard Lee
 *
 * The Janus Chat Client is a highly secured
 * peer-to-peer chat client designed to facilitate
 * the transfer of sensitive data or as a communication
 * medium for the extra paranoid
 *
 * This file contains the unit tests for the user class*/

#include "../lib/exceptions.h"
#include "../lib/user.h"
#include <iostream>
#include <string>

int main ()
{
    try
    {
        //Something that throws an exception
        User bill( );  //use the generic constructor
    }
    catch( BaseException* e )
    {
        //code that handles exception
        std::cout << "Error: " << e->what() << std::endl;
        std::cout << "This user's moniker is: " <<bill.getMoniker( )<<std::endl;  //test getMoniker()

    }

    try
    {
        //Something that throws an exception
        User melissa( "Melissa" );  //use the generic constructor (to make it easy to get a key)
        User samantha ( "Samantha", melissa.getPublicKey( ) );  //test the second constructor and the getPublicKey( )
    }
    catch( BaseException* e )
    {
        //code that handles exception
        std::cout << "Error: " << e->what() << std::endl;
        std::cout << "This user's moniker is: " <<samantha.getMoniker( )<<std::endl;
    }

    try
    {
        //Something that throws an exception
        User marc( "Billy Bob" );
        marc.setMoniker ( "Marc" );  //try out the setMoniker() method
    }
    catch( BaseException* e )
    {
        //code that handles exception
        std::cout << "Error: " << e->what() << std::endl;
        std::cout << "This user's moniker is: " <<marc.getMoniker( )<<std::endl;
    }

    try
    {
        //Something that throws an exception
        User rebecca( );
        //rebecca.getPrivateKey( ); //test to see if this method works at all
    }
    catch( BaseException* e )
    {
        //code that handles exception
        std::cout << "Error: " << e->what() << std::endl;
        std::cout << "This user's moniker is: " <<rebecca.getMoniker( )<<std::endl;
    }

return 0;
}
